//
//  ModelView.swift
//  波形图demo
//
//  Created by apple on 2021/2/19.
//

import SwiftUI

struct ModelView: View {
    
    @State private var showingModal = false
    
    var body: some View {
        
        ZStack{
            
            VStack(spacing: 20){
                Text("sdafdsafasdfasdfasdf")
                Text("sdafdsafasdfasdfasdf")
                Text("sdafdsafasdfasdfasdf")
                Text("sdafdsafasdfasdfasdf")
                Text("sdafdsafasdfasdfasdf")
                Button(action: {
                    self.showingModal = true
                }, label: {
                    Text("显示弹出popup")
                })
            }
            
            if self.showingModal {
                ZStack{
                    Color.black.opacity(0.4)
                    
                    VStack(){
                        Text("pop")
                        
                        Button(action: {
                            self.showingModal = false
                        }, label: {
                            Text("关闭")
                        })
                    }
                }
            }
        }
    }
}


struct ModelView_Previews: PreviewProvider {
    static var previews: some View {
        ModelView()
    }
}
